import service from "@/utils/request";
import { de } from "element-plus/es/locale";
const DEPT_BASE_URL = "/api/";
class vendor {
  ///单位添加
  static AddUnit(data: AddDataQuery) {
    return service({
      url: `${DEPT_BASE_URL}Unit/AddUnit`,
      method: "post",
      data: data,
    });
  }

  //省列表
  static ProvinceList() {
    return service({
      url: `${DEPT_BASE_URL}Unit/ProvinceList`,
      method: "get",
    });
  }
  // 市列表

  static CityList(proVinceId: number) {
    return service<any, any>({
      url: `${DEPT_BASE_URL}Unit/CityList?proVinceId=${proVinceId}`,
      method: "get",
    });
  }
  //区列表
  static UnitList(cityId: number) {
    return service<any, any>({
      url: `${DEPT_BASE_URL}Unit/UnitList?cityId=${cityId}`,
      method: "get",
    });
  }
}
export default vendor;

export interface AddDataQuery {
  companyId: number;
  companyName: string;
  companyAbbreviation: string;
  companyLogo: string;
  companyLabel: string;
  areaId: number;
  cityId: number;
  proVinceId: number;
  addr: string;
  companyPhone: string;
  companyNode: string;
  describee: string;
  responsiblePerson: string;
  financePerson: string;
  responsibilitiesPerson: string;
  lookPerson: number;
  accountingUnit: number;
  isdelete: number;
}

export interface FileInfo {
  name: string;
  url: string;
}
